<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of menu_model
 *
 * @author agasi
 */
class User_model extends CI_Model {
    //put your code here
    function __construct() 
    {
        parent::__construct();
    }
    
    function get_all_user() 
    {
        //Select table name
        $table_name = "sys_user";

        //Build contents query
        $this->db->select('user_id,user_nama,user_real_nama,user_email,user_status')->from($table_name);
        $this->flexigrid->build_query();

        //Get contents
        $return['records'] = $this->db->get();
        //echo $this->db->last_query();
        //Build count query
        $this->db->select('count(user_id) as record_count')->from($table_name);
        $this->flexigrid->build_query(FALSE);
        $record_count = $this->db->get();
        $row = $record_count->row();

        //Get Record Count
        $return['record_count'] = $row->record_count;

        //Return all
        return $return;
    }
}

/* End of file user_model.php */
/* Location: ./application/model/sistem/user_model.php */